import http from './http'

const thingsType = () => {
    return http.get('/system/dict/data/type/iot_things_type')
}

const dataType = () => {
    return http.get('system/dict/data/type/iot_data_type')
}

const iotYesNo = () => {
    return http.get('system/dict/data/type/iot_yes_no')
}

// 获取列表数据
const getList = (pageNum = 1, pageSize = 10,_, templateName, type) => {
    return http.get('iot/template/list', {
        params: {
            pageNum,
            pageSize,
            templateName,
            type
        }
    })
}
// 获取某条数据信息
const getInfo = (templateId) => {
    return http.get('iot/template/' + templateId)
}

// 新增某条数据
const insertInfo = (data) => {
    return http.post('iot/template', data)
}

//更改某条数据 
const updateInfo = (data) => {
    return http.put('iot/template', data)
}
export default {
    thingsType,
    dataType,
    iotYesNo,
    getList,
    getInfo,
    insertInfo,
    updateInfo
}